﻿namespace BeatEmUp.World
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.Xna.Framework;
    using Microsoft.Xna.Framework.Graphics;
    using Microsoft.Xna.Framework.Input;
    using BeatEmUp.Menu;
    using BeatEmUp.Characters.Enemies;
    using BeatEmUp.HUD;
    using BeatEmUp.Items.Weapons;
    using BeatEmUp.Enums;
    using Microsoft.Xna.Framework.Content;

    public class Viewport
    {
        private int worldPosition;

        public int WorldPosition
        {
            set
            {
                if (value < 0)
                    value = 0;

                if (value > this.WorldEndingAt)
                    value = this.WorldEndingAt;

                this.worldPosition = value;
            }
            get
            {
                return this.worldPosition;
            }
        }

        public int WorldEndingAt
        {
            private set;
            get;
        }

        public int GameWidth
        {
            private set;
            get;
        }

        public Viewport(int gameWidth, int worldEndingAt)
        {
            this.worldPosition = 0;
            this.GameWidth = gameWidth;
            this.WorldEndingAt = worldEndingAt;
        }

        public bool WorldEnded()
        {
            return this.WorldPosition == this.WorldEndingAt;
        }
    }
}
